package com.sk.cardeal.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by sk on 2018/1/12.
 */

public class Parts implements Parcelable {

    /**
     * vin : 1001002
     * name : 奔驰发动机盖
     * quality : 2
     * price : 998
     * picUrl : 1231231
     * partsSelfCode : kkkk3ppp1
     * goodsCode : kkkk7905678
     * count : 10000
     * warehousePartsId : 10
     * type : 2
     */

    private String vin;
    private String name;
    private String quality;
    private double price;
    private String picUrl;
    private String partsSelfCode;
    private String goodsCode;
    private int count;
    private String warehousePartsId;
    private int type;
    private int selectCount = 0;
    private boolean isOpen = false;
    private double editPrice;


    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        this.quality = quality;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public String getPartsSelfCode() {
        return partsSelfCode;
    }

    public void setPartsSelfCode(String partsSelfCode) {
        this.partsSelfCode = partsSelfCode;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getWarehousePartsId() {
        return warehousePartsId;
    }

    public void setWarehousePartsId(String warehousePartsId) {
        this.warehousePartsId = warehousePartsId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSelectCount() {
        return selectCount;
    }

    public void setSelectCount(int selectCount) {
        this.selectCount = selectCount;
    }

    public boolean isOpen() {
        return isOpen;
    }

    public void setOpen(boolean open) {
        isOpen = open;
    }

    public double getEditPrice() {
        return editPrice;
    }

    public void setEditPrice(double editPrice) {
        this.editPrice = editPrice;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.vin);
        dest.writeString(this.name);
        dest.writeString(this.quality);
        dest.writeDouble(this.price);
        dest.writeString(this.picUrl);
        dest.writeString(this.partsSelfCode);
        dest.writeString(this.goodsCode);
        dest.writeInt(this.count);
        dest.writeString(this.warehousePartsId);
        dest.writeInt(this.type);
        dest.writeInt(this.selectCount);
        dest.writeByte(this.isOpen ? (byte) 1 : (byte) 0);
        dest.writeDouble(this.editPrice);
    }

    public Parts() {
    }

    protected Parts(Parcel in) {
        this.vin = in.readString();
        this.name = in.readString();
        this.quality = in.readString();
        this.price = in.readDouble();
        this.picUrl = in.readString();
        this.partsSelfCode = in.readString();
        this.goodsCode = in.readString();
        this.count = in.readInt();
        this.warehousePartsId = in.readString();
        this.type = in.readInt();
        this.selectCount = in.readInt();
        this.isOpen = in.readByte() != 0;
        this.editPrice = in.readDouble();
    }

    public static final Parcelable.Creator<Parts> CREATOR = new Parcelable.Creator<Parts>() {
        @Override
        public Parts createFromParcel(Parcel source) {
            return new Parts(source);
        }

        @Override
        public Parts[] newArray(int size) {
            return new Parts[size];
        }
    };
}
